# Reference: https://postmarketos.org/uipkg
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=postmarketos-base-ui-plasma
pkgver=2
pkgrel=10
pkgdesc="Meta package for shared configuration for Plasma-based UIs"
url="https://postmarketos.org"
arch="noarch !armhf" # armhf is not supported
license="GPL-3.0-or-later"
depends="
	bluedevil
	breeze
	dnsmasq
	iio-sensor-proxy
	kscreen
	kwallet-pam
	kwayland-integration
	modemmanager
	polkit-kde-agent-1
	postmarketos-base-ui
	postmarketos-base-ui-networkmanager
	powerdevil
	urfkill
	xdg-desktop-portal-kde
	"
# Required to launch
depends="$depends
	xorg-server
	"
_pmb_recommends="
	breeze-gtk
	discover
	flatpak
	kaccounts-providers
	kde-gtk-config
	maliit-keyboard
	postmarketos-artwork-wallpapers
	snapshot
	xdg-user-dirs
	"
subpackages="$pkgname-openrc"
source="
	gtk-app-wayland.sh
	kdewallet.kwl
	kdewallet.salt
	qtlogging.ini
	"
options="!check pmb:gpu-accel"

package() {
	install -Dm644 \
		"$srcdir"/qtlogging.ini \
		-t "$pkgdir"/etc/xdg/QtProject/

	install -Dm755 \
		"$srcdir"/gtk-app-wayland.sh \
		-t "$pkgdir"/etc/profile.d/

	# TODO: remove once keyboard input bug is fixed
	# https://bugs.kde.org/show_bug.cgi?id=435183
	install -Dm600 -t "$pkgdir"/etc/skel/.local/share/kwalletd \
		"$srcdir"/kdewallet.kwl \
		"$srcdir"/kdewallet.salt
}

openrc() {
	install_if="$pkgname=$pkgver-r$pkgrel openrc"
	install="$subpkgname.post-install $subpkgname.post-upgrade"
	depends="
		bluez-openrc
		elogind
		elogind-openrc
		iio-sensor-proxy-openrc
		networkmanager-openrc
		urfkill-openrc
		"

	mkdir -p "$subpkgdir"
}

sha512sums="
57793bb079c76ba3bdcfca7880aa887de11fe80e7a05557b78435e57feabab70fbaeedc42da3aec6f914c35bba8e8ee9918367516eb45ee247f63f694624f179  gtk-app-wayland.sh
923309f71ee0840ae49d610ab5c11260432f462709eee7148ee5a4703872b9926a3267b16b524162c1560e0798c63fe392a161a57be5c6000bbb1e3f0c947e25  kdewallet.kwl
f3fdaaaf13e985166b86158d5a60098aa45195ea078a4cab7fbf12d3aa428000af3e46ec011dbdc38a4c00faeac5f9a3b5bc2765a6afdd0f1ee58616e31e7429  kdewallet.salt
341f0b866c315f37868ef3e7137cce8b53a0e8e6164e5af71b3e8e2fa68321afbf0652d76124ef84bade1393f701748852ac939aef9daff7e272a0df827780eb  qtlogging.ini
"
